﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DMHelper.Models
{
    public class BooleanField
    {
        private Boolean _value = false;
        public Boolean Value
        {
            get
            {
                return _value;
            }
            set
            {
                _value = value;
            }
        }

        public BooleanField()
        {
        }

        public BooleanField(Boolean content)
        {
            _value = content;
        }
    }
    public class NumericalField
    {
                public NumericalField()
        {
        }
                public NumericalField(Int32 content)
        {
            _value = content;
        }
        private Int32 _value = 0;

public virtual Int32 Value
{
  get { return _value; }
  set { _value = value; }
}
    }

        public class StringField
    {
        private String _value = "";
        public StringField()
        {
        }
        public StringField(String content)
        {
            _value = content;
        }
public virtual String Value
{
  get { return _value; }
  set { _value = value; }
}
    }

        public class ReferenceNumericalField : NumericalField
        {
            NumericalField _reference = new NumericalField();
            public ReferenceNumericalField(NumericalField reference)
            {
                _reference = reference;
            }

            public override int Value
            {
                get
                {
                    return _reference.Value;
                }
                set
                {
                   
                }
            }
        }

        public class ReferenceStringField : StringField
        {
            StringField _reference;
            public ReferenceStringField(StringField reference)
            {
                _reference = reference;
            }

            public override String Value
            {
                get
                {
                    return _reference.Value;
                }
                set
                {

                }
            }
        }

        public class AdditionNumericalField : NumericalField
        {
            public List<NumericalField> listeModifier = new List<NumericalField>();
            public override int Value
            {
                get
                {
                    Int32 retour = 0;
                    foreach (NumericalField n in listeModifier)
                    {
                        retour += n.Value;
                    }
                    return base.Value;
                }
                set
                {

                }
            }

        }

        
}
